<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2018年吴中区中考成绩查询系统</title>
    <link rel="stylesheet" href="${ctxPath}/static/portal/css/reset.css">
    <link rel="stylesheet" href="${ctxPath}/static/portal/css/query-system.css">
<style>
    .qs-line p input {

        width: 205px;
    }
</style>
</head>
<body>
<div class="qs-wrap">
    <div class="qs-title">
        <p><img src="${ctxPath}/static/portal/images/logo_01.png"></p>
    </div>

    <div class="qs-content">
        <form id="inquiryForm" action="${ctxPath}/portal/scoreInquiry" method="post">
            <div class="qs-line">
                <p><i>准考证号:</i><input type="text" id="examCardNumber" name="examCardNumber"/></p>
                <div class="errordiv"
                     style="color: red; text-align: center; height: 24px; line-height: 24px;float: left;text-indent: 4px;"></div>
            </div>
            <div class="qs-line">
                <p><i>考场号:</i><input type="text" id="examSiteNumber" name="examSiteNumber"/></p>
                <div class="errordiv"
                     style="color: red; text-align: center; height: 24px; line-height: 24px;float: left;text-indent: 4px;"></div>
            </div>
            <div class="qs-line">
                <p><i>座位号:</i><input type="text" id="seatNumber" name="seatNumber"/></p>
                <div class="errordiv"
                     style="color: red; text-align: center; height: 24px; line-height: 24px;float: left;text-indent: 4px;"></div>
            </div>
            @if(kaptcha.getScoreKaptchaOnOff() == true){
            <div class="qs-line">
                <p><i>验证码:</i><input type="text" style="width: 115px;" id="verification" name="kaptcha" />
                    <div class="yzm-code">
                        <img src="${ctxPath}/kaptcha" id="kaptcha" width="80px" height="28px" style="padding-left:8px;"/>
                    </div>
                </p>
                <div class="errordiv"
                     style="color: red; text-align: center; height: 24px; line-height: 24px;float: left;text-indent: 4px;"></div>
            </div>
            @}
            <div class="errordiv"
                 style="color: red; text-align: center; height: 24px; line-height: 24px;">${message!}
            </div>
            <div class="qs-btns" style="padding-left: 150px;">
                <input type="button" onclick="inquiry()" value="查询"/>
                <input type="button" style="margin-left:55px;" onclick="reset()" value="重置"/>
            </div>
        </form>
    </div>

</div>

</body>
<script src="${ctxPath}/static/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctxPath}/static/js/common/Feng.js"></script>
<script type="text/javascript">
    $("#kaptcha")
        .on(
            'click',
            function() {
                $("#kaptcha").attr(
                    'src',
                    '${ctxPath}/kaptcha?'
                    + Math.floor(Math.random() * 100))
                    .fadeIn();
            });

    function check() {
        var result = true;
        var examCardNumber = $("#examCardNumber").val();
        var examSiteNumber = $("#examSiteNumber").val();
        var seatNumber = $("#seatNumber").val();
        //var kaptcha = $("#kaptcha").val() ;

        if (examCardNumber == "") {
            $("#examCardNumber").parent().next().html("准考证号不能为空");
            result = false;
        } else if (examCardNumber.length > 20) {
            $("#examCardNumber").parent().next().html("准考证号不能超过20位");
            result = false;
        }else{
            $("#examCardNumber").parent().next().html("");
        }
        if (examSiteNumber == "") {
            $("#examSiteNumber").parent().next().html("考场号不能为空");
            result = false;
        } else if (examSiteNumber.length > 10) {
            $("#examSiteNumber").parent().next().html("考场号不能超过10位");
            result = false;
        }else{
            $("#examSiteNumber").parent().next().html("");
        }
//        if (kaptcha == ""){
//            $("#errordiv").parent().next().html("验证码不能为空");
//            result = false;
//        }
        if (seatNumber == "") {
            $("#seatNumber").parent().next().html("座位号不能为空");
            result = false;
        } else if (seatNumber.length > 10) {
            $("#seatNumber").parent().next().html("座位号不能超过10位");
            result = false;
        }else{
            $("#seatNumber").parent().next().html("");
        }
        return result;
    }

    function inquiry() {
        if(check()){
            $("#inquiryForm").submit();
        }
    }

    function reset() {
        $("input:text").val("");
    }
</script>
</html>